<template>
  <h1>单选组件</h1>
  <h3>请选择您的学历</h3>
  <el-radio-group v-model="radio">
    <el-radio value="初中">学历：初中</el-radio>
    <el-radio value="高中" label="学历:高中"></el-radio>
    <el-radio value="本科" label="学历:本科"></el-radio>
    <el-radio value="研究生" label="学历:研究生"></el-radio>
  </el-radio-group>
  <br>
  <h4>您选择的学历是：{{radio}}</h4>
  <hr>
  <h3>请选择您想查看的商品</h3>
  <el-radio-group v-model="pri">
    <el-radio-button v-for="p in arr" :label="p.title" :value="p.price"></el-radio-button>
  </el-radio-group>
  <h4>您选择的商品价格为:{{pri}}</h4>
</template>

<script setup>
  import {ref} from "vue";

  const radio = ref('本科');

  const arr = ref([
    {title:'茅台',price:3800},
    {title:'五粮液',price:2800},
    {title:'梦之蓝',price:1800},
    {title:'汾酒',price:800}
  ]);
  const pri = ref(3800);
</script>

<style scoped>

</style>